package com.cgc.game.base;

public class Rect {
	public int x;
	public int y;
	public int dx;
	public int dy;
	
	public Rect(){
		x = y = dx = dy = 0;
	}
	
	public Rect(int x, int y, int w, int h){
		this.x = x;
		this.y = y;
		this.dx = w;
		this.dy = h;
	}
	
	public Rect(Rect rt){
		if(rt != null){
			this.x = rt.x;
			this.y = rt.y;
			this.dx = rt.dx;
			this.dy = rt.dy;
		}
	}
	
	public void Set(int x, int y){
		this.x = x;
		this.y = y;
	}
	
	public void Set(int x, int y, int dx, int dy){
		this.x = x;
		this.y = y;
		this.dx = dx;
		this.dy = dy;
	}
	
	public void Set(Rect rt){
		if(rt != null){
			x = rt.x;
			y = rt.y;
			dx = rt.dx;
			dy = rt.dy;
		}
	}
	
	public String toString(){
		return "x = " + x + ",y = " + y + ",dx = " + dx + ",dy = " + dy;
	}
};
